import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/sentgoods',
    rediect: '/sentgoods/allgoods',
    name: 'SentGoods',
    component: () => import(/* webpackChunkName: "SearchPop" */ '../views/sentgoods.vue'),
    children: [{
      path: '/sentgoods/allgoods',
      name: 'Allgoods',
      component: () => import(/* webpackChunkName: "SearchPop" */ '../views/allgoods.vue')
    }, {
      path: '/sentgoods/waitSent',
      name: 'Waitsend',
      component: () => import(/* webpackChunkName: "Waitsend" */ '../views/waitSent.vue')
    },
    {
      path: '/sentgoods/acceptSentData',
      name: 'AcceptSentData',
      component: () => import(/* webpackChunkName: "Waitsend" */ '../views/acceptSentData.vue')
    }, {
      path: '/sentgoods/waitcomment',
      name: 'Waitcomment',
      component: () => import(/* webpackChunkName: "Waitsend" */ '../views/waitcomment.vue')
    }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
